﻿// =================================================================== 
// 项目说明
//====================================================================
// liucx @Copy Right 2019
// 文件： CarSerialRepository.cs
// 项目名称：斑马车务
// 创建时间：2019/9/20
// 负责人：liucx
// ===================================================================
using System;
using System.Text;
using System.Collections.Generic;
using YouWei.Infrastructure.Entity;

namespace YouWei.Infrastructure.Repository
{
    /// <summary>
    /// 仓储层
    /// </summary>	
    public class CarSerialRepository : BaseRepository<CarSerial>
    {

        #region 构造

        public CarSerialRepository() : base() { }

        public CarSerialRepository(string connectionString) : base(connectionString) { }

        public CarSerialRepository(DatabaseContext dbContext) : base(dbContext) { }

        #endregion

        /// <summary>
        /// 根据品牌ID获取车型列表
        /// </summary>
        /// <param name="BrandID"></param>
        /// <returns></returns>

        public List<CarSerial> GetSerialListByBrandId(int BrandID)
        {
            StringBuilder sb = new StringBuilder("SELECT * FROM CarSerial with(nolock) ");
            sb.Append(" WHERE BrandID=@BrandID ORDER BY SerialID DESC");
            return Query(sb.ToString(), new { BrandID = BrandID });
        }
    }
}